# -*- mode: Python; coding: utf-8; -*-
import platform, os

# domyślne środowisko kompilacji
release_env = Environment(CCFLAGS = ['-Wall', '-ansi'],
                          LINKFLAGS = ['-Wall'])
# środowisko do analizu pokrycia kodu testami
coverage_env = release_env.Clone()
coverage_env.AppendUnique(CCFLAGS = ['--coverage'],
                          LINKFLAGS = ['--coverage'])
# środowisko do debuggowania
debug_env = release_env.Clone()
debug_env.AppendUnique(CCFLAGS = ['-g'],
                       LINKFLAGS = ['-g'])

mode = ARGUMENTS.get('mode', 'release')
print '*** Compiling in ' + mode + ' mode...'

if mode == 'release':
   Export({'env':release_env})
elif mode == 'coverage':
   Export({'env':coverage_env})
elif mode == 'debug':
   Export({'env':debug_env})
else:
   print "Error: expected 'debug' or 'release', found: " + mode
   Exit(1)

SConscript('ged/SConscript')
SConscript('GUI/SConscript')
SConscript('tests/SConscript')

Default('ged')
